package game.players.user.movements;

import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.events.constants.Key;

import game.players.SoccerPlayer;

public class WithoutBallDiagonalLeftUpMovingUser extends WithoutBallAbstractMovingUser {

	public WithoutBallDiagonalLeftUpMovingUser(SoccerPlayer player, double x, double y) {
		super(player, x, y);
		this.getPlayer().setLeftAnimationWithSpeed(0.1);
	}
	
	@Override
	public void update(DeltaState deltaState) {
		if (!deltaState.isKeyBeingHold(Key.UP))
			this.getPlayer().setState(new WithoutBallLeftMovingUser(this.getPlayer(), this.getX(), 0));
		
		if (!deltaState.isKeyBeingHold(Key.LEFT))
			this.getPlayer().setState(new WithoutBallUpMovingUser(this.getPlayer(), 0, this.getY()));
		
		if (!deltaState.isKeyBeingHold(Key.LEFT) && !deltaState.isKeyBeingHold(Key.UP))
			this.getPlayer().setState(new WithoutBallStationaryUser(this.getPlayer()));
		
		super.update(deltaState);
	}

	@Override
	public boolean isRight() {
		return false;
	}

}
